//
//  SpendFunkAppDelegate.h
//  SpendFunk
//
//  Created by bm on 4/18/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

#import "HomeViewController.h";
#import "LoginViewController.h"
#import "SignupViewController.h"
#import "FindFriendsViewController.h"
#import "MainViewController.h"
#import "FeatureMembersController.h"
#import "InviteFriendsViewController.h"
#import "ContactDetailViewController.h"
#import "SearchUsersViewController.h"
//#import "CategoryViewController.h"
#import "Post1ViewController.h"
@class SpendFunkAppDelegate;

extern SpendFunkAppDelegate *g_AppDelegate;
@interface SpendFunkAppDelegate : NSObject <UIApplicationDelegate> {
	UIWindow *window;
	HomeViewController *m_pHomeViewCtrl;
	
	UINavigationController* navigation;
	
	FindFriendsViewController *m_pFindFriendCtrl;
	LoginViewController		*m_pLoginViewCtrl;
	SignupViewController	*m_pSignupViewCtrl;
	
	MainViewController		*m_pMainViewCtrl;
	FeatureMembersController *m_pFeatureMemberCtrl;
    
    InviteFriendsViewController *m_pInviteFriendsCtrl;
    ContactDetailViewController *m_pContactDetailCtrl;
	SearchUsersViewController *m_pSearchUsers;
	//CategoryViewController *cate;
	Post1ViewController *post;
	
}
-(void)openLogin;
-(void)openSignup;
-(void)openFeaturedMembersWithMembers:(NSArray *)members;
-(void)openFindFriendsByView:(UIView *)view;
-(void)openListContact;
-(void)openDetailContact;
-(void)openUserProfile:(NSDictionary *)userProfile;
-(void)goBackHome:(UIView *)view;
-(void)openFindFriends;
-(void)openLocationView;
-(void)openBadgesView;
-(void)openHighView;
-(void)openFeedView;
-(void)onClickToPost2;
-(void)backToPost1;
- (void)openPriceView;
-(void)openSearchforUsers;
-(void)openLocationViewwithFS_ID:(NSString*)fsquareID gLat:(NSString*)gLat gLong:(NSString*)gLong aMount:(NSString*)amount Address:(NSString*)Address City:(NSString*)city;
- (void)openCommentView:(NSString*)spendID;
@property (nonatomic, retain) IBOutlet UIWindow *window;

@end



static void animateView(UIView* view ,NSString *transition,NSString *direction,NSTimeInterval duration){
	// Set up the animation
	CATransition *animation = [CATransition animation];
	[animation setDelegate:view];
	// Set the type and if appropriate direction of the transition, 
	if (transition == kCATransitionFade) {
		[animation setType:kCATransitionFade];
	} else {
		[animation setType:transition];
		[animation setSubtype:direction];
	}	
	// Set the duration and timing function of the transtion -- duration is passed in as a parameter, use ease in/ease out as the timing function
	[animation setDuration:duration];
	[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];	
	[[view layer] addAnimation:animation forKey:@"animationTransition"];
	[[view layer] removeAnimationForKey:@"animationTransition"];
}





